package signIn;

import models.BaseModel;
import models.constants.DeletedStatus;
import models.weixin.WebUser;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by liuBin on 2017/8/5.
 */
@Entity
@Table(name = "webuser_sign_in_historys")
public class WebUserSignInHistory extends BaseModel {

    /**
     *  用户
     */
    @JoinColumn(name = "web_user_sign_in_id")
    @ManyToOne
    public WebUserSignIn webUserSignIn;

    /**
     * 签到日期
     */
    @Column(name = "begin_date")
    @Temporal(TemporalType.TIMESTAMP)
    public Date signInDate;

    /**
     * 逻辑删除状态
     */
    @Column(name = "deleted")
    @Enumerated(EnumType.ORDINAL)
    public DeletedStatus deleted;

    public WebUserSignInHistory(WebUserSignIn webUserSignIn,Date signInDate) {
        this.webUserSignIn = webUserSignIn;
        this.signInDate = signInDate;
        this.deleted = DeletedStatus.UN_DELETED;
        this.createAt = new Date();
    }

}
